import pandas as pd

player = pd.read_json("cansaixuanshou_20240225.json", encoding="UTF-8")
player_height = player["height"]
player_height = player_height.str.slice(0, 3).astype(int)
average_height = int(player_height.mean())  # 求平均值

player_weight = player["weight"]
player_weight = player_weight.str.slice(0, 2).astype(int)
player["weight_int"] = player_weight
average_weight = int(player_weight.mean())  # 求平均值

print("平均身高：%s cm" % average_height)
print("平均体重：%s kg" % average_weight)
